RHQ and SSL
RHQ utilizes SSL technology to perform both encryption and authentication. You can enable encryption (scrambling the data between server and agent to avoid someone eavesdropping on the traffic) and optionally enable authentication (which prohibits an intruder from attempting to spoof either a RHQ Server or RHQ Agent). It is recommended that you understand the basics of SSL and certificate-based security before attempting to secure your RHQ communications.
Encryption
By simply using a transport that uses SSL, you automatically get encryption. This means that when you configure your RHQ Server and RHQ Agent's communications layer, use an SSL-enabled transport to encrypt the traffic. SSL-enabled transports includes sslservlet and sslsocket. You do not have to worry about setting up certificates if you want to use SSL-enabled transports just for encryption. The RHQ Server ships with a certificate and the RHQ Agent will create a self-signed certificate if it needs one.
Note that it is possible to just use SSL encryption without authentication. Some people may just wish to encrypt their RHQ traffic, without requiring the RHQ Servers and RHQ Agents authenticating each other. This setup, while less secure, is much easier to setup because it does not require creating and distributing trusted certificates.
Authentication
Authentication via SSL requires that you distribute trusted certificates to your RHQ Servers and RHQ Agents. You must also configure those RHQ Servers and RHQ Agents to reject any messages coming from remote clients that do not match any of those trusted certificates. In order to support authentication, you must use SSL-enabled transports (which include sslservlet and sslsocket). You must also obtain trusted certificates for all your servers and agents and package those certificates in a set of keystore and truststore files. You can configure the RHQ Server to authenticate RHQ Agents, RHQ Agents to authenticate the RHQ Server or both. RHQ provides this flexibility in case you only want to authenticate in one direction but not another. However, when people feel the need for authentication, they will usually enable it in both directions.
Authentication requires a bit more work to setup. Because true authentication requires a high degree of trust, you have to manually create and sign your certificates, create keystores and truststores that contain those certificates, then distribute your keystores and truststores in a highly secure manner to all your RHQ Servers and RHQ Agents. This may mean going as far as physically hand-delivering your trusted certificates via memory stick and copying the certificates from the memory stick to all the computers hosting the RHQ Servers and RHQ Agents. Many times it is not as highly paranoid as that - however, at some point along the way, you have to place trust in whatever certificates you are using and distributing.
Setting Up Secure RHQ Communications
The following are the steps necessary to set up secure communications in RHQ. Remember that you have the option for encryption-only or encryption-with-authentication. If you choose the former, you do not need to perform any of the steps dealing with the creation, packaging and distribution of certificates and keystores/truststores. If you wish to have full security with encryption-with-authentication, follow all the steps listed below. If you are setting up with encryption-with-authentication, these steps assume you want authentication in both directions (that is, the agents will need to authenticate with the server and the server will need to authenticate with the agents).
The RHQ low-level communications layer is based on JBoss/Remoting and uses what is known as a transport to ship messages back and forth between agents and servers. A transport can be either unencrypted (like the raw socket transport or servlet) or it can be encrypted (like sslsocket or sslservlet).
The RHQ Agent does not host a servlet container, so you cannot use a servlet based transport (servlet, sslservlet) for server-to-agent communications. You can only use servlet based transports for agent-to-server communications.
The servlet-based transports, servlet and sslservlet, are HTTP and HTTPS transports respectively. They are "servlet"-based because the HTTP/HTTPS traffic is routed through a servlet running in the Tomcat server hosted within the RHQ Server. We use these servlet based transports because they leverage the highly performant Tomcat connector infrastructure with no need for additional thread pooling to accept incoming agent requests since Tomcat will handle the requests. Using these servlet-based transports means that the configuration you set up here for agent communications are the same settings that take effect for user requests coming into the GUI via a browser.
You may not want the communications security to be configured the same for both user browsers and agents. For example, you may want your agents to always SSL-authenticate themselves with certificates but you might not want to require your users to have their own certificates installed in their browsers just to access the RHQ GUI over https. In this case, you will want to either a) use non-servlet-based transports for agent-to-server communications or b) configure Tomcat to allow browsers to access the GUI through a second, less secure port.
To do a), you will want to use the sslsocket transport which does not utilize the Tomcat server when receiving incoming agent requests. The sslsocket transport will use its own SSL configuration, external to the Tomcat SSL configuration, thus allowing agents to be secured one way while allowing browser requests to the GUI over https to be secured another way. If you want to configure the agent communication using this method, read Setting Up Server-Side sslsocket Transport.
To do b), you have to add another web connector to the RHQ Server's Tomcat configuration that provides a secure but un-authenticated https connector for browsers to use. Once you add this new web connector, you will be able to tell your users to connect their browsers to that connector's port (e.g. https://your-server-hostname:9443) in order to access the RHQ GUI using https without requiring certificate authentication. This leaves the original secure Tomcat connector free to accept certificate-authenticated agent requests. You can add such a web connector using the JBossAS CLI located at $JBOSS_HOME/bin/jboss-cli.[sh,bat] (where $JBOSS_HOME is typically <rhq-server-install-dir>/jbossas unless you installed RHQ inside an external AS installation). For example, to add a new web connector on port 9443, you use the JBoss CLI first to create a new socket binding for that port 9443, then to create a new web connector using that new socket binding:
jboss-cli.sh --connect --command='/socket-binding-group=standard-sockets/socket-binding=httpsbrowser/:add(port=9443)'
jboss-cli.sh --connect --command='/subsystem=web/connector=httpsbrowser/:add(socket-binding=httpsbrowser,scheme=https,protocol=HTTP/1.1,secure=true,enabled=true)'
jboss-cli.sh --connect --command='/subsystem=web/connector=httpsbrowser/ssl=configuration:add(name=ssl,verify-client=false,key-alias=RHQ,password=RHQManagement,certificate-key-file=${jboss.server.config.dir}/rhq.keystore,certificate-file=${jboss.server.config.dir}/rhq.keystore'
jboss-cli.sh --connect --command='/:reload'
Notice that the above command that creates the SSL configuration assumes you want to use the self-signed certificate found in RHQ's keystore that comes with RHQ. You can use (and it is recommended that you do use) your own certificate, especially if you want one that is not self-signed. In case you do not want to use RHQ's keystore, make sure you put your own keystore's information in the above command (specifically, the key-alias, password, certificate-key-file and certificate-file values).
For the following steps, we are going to configure the server-to-agent channel to use the sslsocket transport and the agent-to-server channel to use the sslservlet transport.
After you set up everything and you have started the server, go to the Administration > Topology > Servers page and verify that the public endpoint address and port are the ones you want. If you see that these values do not match the values that you want, the agents will not be able to talk to the server. Edit the server definition in the UI so they match the values you expect.
Step 1 - Use SSL Transport To Enable Encryption
The first thing you need to do is tell the RHQ Servers and RHQ Agents to use SSL when talking to each other.
RHQ Server Instructions
-
Shutdown the RHQ Server
-
Go to the /bin directory under the location where your RHQ Server is installed
-
In that directory, find the file rhq-server.properties and load it into your favourite text editor
-
Find the following configuration preferences used to set the server's communications connector and set them appropriately:
rhq.communications.connector.transport=sslservlet
rhq.communications.connector.bind-address=
rhq.communications.connector.bind-port=
rhq.communications.connector.transport-params=/jboss-remoting-servlet-invoker/ServerInvokerServlet
where transport is the SSL transport you wish to use - sslservlet in this case. Because we are using sslservlet transport, the other settings can typically be left as-is - empty value defaults for bind-address and bind-port and the servlet path for transport-params.
-
If you only want SSL encryption, ensure that certificate based authentication is disabled by having the following properties set as below:
rhq.server.tomcat.security.client-auth-mode=false
rhq.server.client.security.server-auth-mode-enabled=false
-
(Optional) You may wish to explicitly define the secure socket protocol used by this connector, although the default (TLS) is usually good enough. If the default protocol of TLS is not what you want, find the following configuration preferences and set them appropriately:
rhq.server.tomcat.security.secure-socket-protocol=TLS
rhq.server.client.security.secure-socket-protocol=TLS
-
Save the configuration file
-
If you do not plan on proceeding to setup SSL authentication at this stage, you can restart the RHQ Server.
Due to some limitations within the app server, there are two RHQ settings that will not take effect immediately upon restart if you change their values after the initial installation. These are settings for the web connector's keystore and truststore file locations (rhq.server.tomcat.security.keystore.file and rhq.server.tomcat.security.truststore.file). If you ever need to change those values after you've installed RHQ, you will need to change them in the app server's standalone/configuration/standalone-full.xml file in the <ssl> node of the https <connector>.
RHQ Agent Instructions
There are several ways to set the agent SSL configuration preferences. You can either:
-
start the RHQ Agent in advanced setup mode using the command line options --cleanconfig --setup --advanced
-
from the agent prompt, you can enter the command setup advanced
-
you can directly edit the conf/agent-configuration.xml file and restart the agent with the --cleanconfig command line option
If you want to set these preferences using the advanced setup mode, you can enter !? at any prompt to get help.
The following instructions will assume you are going through the prompts in setup mode, but they will also tell you the specific configuration preference names that are being set in case you want to directly edit the agent-configuration.xml file.
Unless specified in the following instructions, you can accept the default values for the setup prompts.
-
Answer all prompts until you get to the prompt asking for the Agent Transport Protocol and enter sslsocket. The name for this configuration preference is rhq.communications.connector.transport.
-
At the prompt asking for the RHQ Server Hostname or IP Address, enter the public endpoint address of the RHQ Server. This is typically just the hostname where your server is running. If you are not sure of this value, you can easily determine it by going to the server GUI's Administration > Topology > Servers page - the public endpoint is listed there. Note that this hostname or IP address must be routable by the agent, otherwise, the agent will get connection failures when it tries to talk to the server. The name for this configuration preference is rhq.agent.server.bind-address.
-
At the prompt asking for the RHQ Server Port, enter the port that the RHQ Server will be listening to for agent requests. Because we are using the sslservlet transport, this will be the Tomcat secure port, whose default is 7443. The name for this configuration preference is rhq.agent.server.bind-port.
-
At the prompt asking for the RHQ Server Transport Protocol, enter sslservlet which is the RHQ Server's new transport that we set in the previous section. The name for this configuration preference is rhq.agent.server.transport.
-
At the prompt asking for the RHQ Server Transport Parameters, enter the RHQ Server's new transport parameters as defined by its rhq.communications.connector.transport-params setting which, for sslservlet transport, must be "/jboss-remoting-servlet-invoker/ServerInvokerServlet". The name for this configuration preference is rhq.agent.server.transport-params.
-
If you only want SSL encryption, ensure that certificate based authentication is disabled by having the following properties set:
-
(Optional) You may wish to explicitly define the agent connector's transport parameters. You may also wish to explicitly set the secure socket protocols used by the agent (however, the default protocol of TLS is usually sufficient).
-
Agent Transport Parameters are the optional JBoss/Remoting transport parameters that are used by the agent and server to interact with the agent's connector. See the JBoss/Remoting documentation for specifics. The name for this configuration preference is rhq.communications.connector.transport-params.
-
Incoming Secure Socket Protocol is the protocol used when accepting incoming messages from the RHQ Server (make sure this matches the RHQ Server's protocol setting rhq.server.client.security.secure-socket-protocol). The name for this configuration preference is rhq.communications.connector.security.secure-socket-protocol.
-
Outgoing Secure Socket Protocol is the protocol used when sending outgoing messages to the RHQ Server (make sure this matches the RHQ Server's protocol setting rhq.communications.connector.security.secure-socket-protocol). The name for this configuration preference is rhq.agent.client.security.secure-socket-protocol.
-
Exit the agent (effectively shutting it down) and then restart it.
At this point, you have now configured your RHQ Servers and RHQ Agents to encrypt their messages to each other via SSL. You can be assured that no one can effectively eavesdrop on the communications between them. However, if you wish to strengthen the security of the network traffic even further, continue on to the next series of steps which will enable certificate-based authentication between your RHQ Servers and RHQ Agents.
Step 3 - Distribute Your Keystores and Truststores
At this point, you have created a set of keystore files (one for each RHQ Server and RHQ Agent in your RHQ environment) and a single truststore file (a duplicate copy is to be given to each RHQ Server and RHQ Agent). You must now distribute those files to all the machines where your RHQ Servers and RHQ Agents live. You must do so in a secure fashion and ensure that no one can steal, intercept or otherwise manipulate your keystore/truststore files. You must also make sure that you distribute the keystore files to the host machines that match the certificates' CN host addresses. If you mix them up and, for example, put the "myhost" keystore file on the "anotherhost.mycorp.com" machine, the SSL communications will fail for the RHQ Server or RHQ Agent running on "anotherhost".
RHQ Server Instructions
Each RHQ Server distribution is running inside a JBossAS application server instance. That JBossAS has a standalone/configuration subdirectory under its installation directory ($JBOSS_HOME) that you can use for the location to store the server's keystore/truststore files. Technically, you can put them anywhere that the JBossAS server can access them, but the rest of these instructions will assume you will place them in the $JBOSS_HOME/standalone/configuration directory. If you installed RHQ to use the JBossAS that ships with RHQ (which is the typical install scenario), $JBOSS_HOME is $RHQ_SERVER_HOME/jbossas where $RHQ_SERVER_HOME is the directory where you unzipped and installed RHQ itself.
For each RHQ Server, take its keystore file (make sure the keystore file has the appropriate CN value that matches the RHQ Server's hostname) and store it in $JBOSS_HOME/standalone/configuration under the name server.keystore. Make a copy of your truststore file and place it in that same directory under the name all.truststore.
RHQ Agent Instructions
Each RHQ Agent distribution has a /conf directory. It is the logical choice to store the agent's keystore/truststore files. (note: putting them here makes them safe when performing agent auto-updates - agents will retain all keystore/truststore files that are found in the /conf and /data directory). For each RHQ Agent, take its keystore file (make sure the keystore file has the appropriate CN value that matches the RHQ Agent's hostname) and store it in the agent's /conf directory. Make a copy of your truststore file and place it in the agent's /conf directory as well.
Step 4 - Tell The RHQ Servers and Agents About Their Keystores/Truststores
Now you have to tell your RHQ Servers and RHQ Agents where your keystore and truststore files are in addition to providing other information about those files so they can be read properly. After completing this step, your RHQ Servers and RHQ Agents will be able to successfully authenticate themselves to each other.
RHQ Server Instructions
-
Shutdown the RHQ Server.
-
Open the /bin directory in the RHQ Server installation directory.
-
In that directory, find the file rhq-server.properties and load it into your favorite text editor.
-
Find the following configuration preferences used to set the server's security using information about your new keystore and truststore files:
# Server-side SSL Security Configuration for HTTPS thru Tomcat
# These are used for browser https access and
# for incoming messages from agents over sslservlet transport.
# [Due to issue https://issues.jboss.org/browse/WFLY-1177, you cannot change
# rhq.server.tomcat.security.keystore.file or rhq.server.tomcat.security.truststore.file
# after you install RHQ. If you need to change those again, you must manually do so in standalone-full.xml.]
rhq.server.tomcat.security.client-auth-mode=true
rhq.server.tomcat.security.secure-socket-protocol=TLS
rhq.server.tomcat.security.algorithm=SunX509
rhq.server.tomcat.security.keystore.alias=myhost
rhq.server.tomcat.security.keystore.file=${jboss.server.config.dir}/server.keystore
rhq.server.tomcat.security.keystore.password=jonpassword
rhq.server.tomcat.security.keystore.type=JKS
rhq.server.tomcat.security.truststore.file=${jboss.server.config.dir}/all.truststore
rhq.server.tomcat.security.truststore.password=jonpassword
rhq.server.tomcat.security.truststore.type=JKS
...
# Client-side SSL Security Configuration (for outgoing messages to agents)
rhq.server.client.security.secure-socket-protocol=TLS
rhq.server.client.security.keystore.file=${jboss.server.config.dir}/server.keystore
rhq.server.client.security.keystore.algorithm=SunX509
rhq.server.client.security.keystore.type=JKS
rhq.server.client.security.keystore.password=jonpassword
rhq.server.client.security.keystore.key-password=jonpassword
rhq.server.client.security.keystore.alias=myhost
rhq.server.client.security.truststore.file=${jboss.server.config.dir}/all.truststore
rhq.server.client.security.truststore.algorithm=SunX509
rhq.server.client.security.truststore.type=JKS
rhq.server.client.security.truststore.password=jonpassword
rhq.server.client.security.server-auth-mode-enabled=true
What is being configured here is the server-side Tomcat SSL security settings (rhq.server.tomcat.security...) to handle incoming messages from RHQ Agents via the sslservlet transport and the client-side SSL security settings (rhq.server.client.security...) to handle outgoing messages to RHQ Agents via the sslsocket transport. Because we are sharing the keystore and truststore for both directions, a lot of these values are the same.
Since we want to enable both server-side and client-side with SSL authentication, we set rhq.server.tomcat.security.client-auth-mode to "true" (which tells Tomcat to only process an incoming request if it has a valid SSL certificate) and we set rhq.server.client.security.server-auth-mode-enabled to "true" (meaning any outgoing messages sent to a RHQ Agent will only be sent if that RHQ Agent has a valid SSL certificate).
The rest of the settings and their values should be fairly self-evident. You are simply telling the RHQ Server where it can find its keystore and truststore files, the passwords to access data in those files, the alias of the RHQ Server's own certificate as found in the keystore, etc.
-
Save the configuration file
-
Restart the RHQ Server
RHQ Agent Instructions
There are several ways to set the agent SSL configuration preferences. You can either:
-
start the RHQ Agent in advanced setup mode using the command line options --cleanconfig --setup --advanced
-
from the agent prompt, you can enter the command setup advanced
-
you can directly edit the conf/agent-configuration.xml file and restart the agent with the --cleanconfig command line option
If you want to set these preferences using the advanced setup mode, you can enter !? at any prompt to get help.
The following instructions will assume you are going through the prompts in setup mode, but in case you want to directly edit the agent-configuration.xml file, the configuration preference names start with rhq.communications.connector.security or rhq.agent.client.security and match up fairly easily with the prompt names you see below). See the earlier section for more information about other agent setup prompts you will need to set (like Agent Transport Protocol, etc).
Unless specified in the following instructions, you can accept the default values for the setup prompts.
At this point, you have now configured your RHQ Servers and RHQ Agents to both encrypt their messages to each other and to authenticate each other via SSL. You now can be assured that no one can effectively eavesdrop on your RHQ communications nor can an infiltrator attempt to spoof itself as a bogus RHQ Server or RHQ Agent.
Step 5 - Test Your Setup
Once you are done with the preceding steps, you can finally restart your RHQ Servers and RHQ Agents. They should begin to talk to each other normally - if you have done everything correctly, you will not notice anything different! If you want to confirm that they really are using SSL authentication, simply remove a keystore or truststore file from either a RHQ Server or RHQ Agent and you should begin to notice errors appear in their log files. Removing a keystore file or truststore file from a RHQ Agent will prohibit that agent from being able to send and receive messages to/from the RHQ Server - which you can confirm by looking at the agent log file and looking for error messages. After you've finished testing, make sure you remember to restore the keystore/truststore files. You can test the SSL authentication by creating another keystore for one of your RHQ Agents, replace that keystore with the original keystore and try to see if that RHQ Agent can talk to the RHQ Server. Because this new keystore has a certificate that does not exist in the RHQ Server's truststore, the RHQ Server will no longer trust that agent and will reject its messages. In effect, you simulated an infiltrator trying to spoof a RHQ Agent and the RHQ Server detected this security breach.
Setting Up Server-Side sslsocket Transport
As mentioned previously, if you use the sslservlet transport, messages from the agent to the server are routed over secure HTTP through the JBossAS app server's Tomcat web container, the same as when your users make browser requests to the server GUI.
If:
-
you wish to allow your users to access the server GUI over the secure https: protocol...
-
and you use sslservlet transport...
-
and you require agents to authenticate themselves to the server via SSL certificates
then you will also require your users' browsers to have certificates installed and those user certificates must be placed in your server-side truststore file; otherwise, your users that try to access the server GUI over https: will find that Tomcat will reject their requests due to missing certificates, even if the user can authenticate themselves using their RHQ username and password. In highly secure environments, this may not be a problem because users might already have certificates assigned to them and installed in their browser and you might be able to get or build a truststore that contains all of your users' certificates. However, under most situations, this is not desireable. Users normally do not have their own certificates installed in their browsers and even if they did, you probably cannot obtain their certificates ahead of time to place them in the server's truststore.
The users will authenticate themselves to the server GUI via their own RHQ username and password. So the question becomes, how can you require agents to authenticate themselves with certificates without requiring users to do so?
The first way you can do this is (as mentioned above) have the agents talk to the server over one secure web HTTP port (for example, 7443) and have the user browsers talk to the server over another secure web HTTP port (for example, 9443 such as https://your-server:9443). This solution is described above and will not be repeated here.
The second way you can do this lies in the ability of RHQ to use a different transport. Rather than have the agents talk to the server over secure HTTP through Tomcat using the sslservlet transport, we can tell the servers and agents to use the non-HTTP based sslsocket transport instead (this is the same transport that is used when the server sends messages to the agent - now we are simply saying the messages flowing in the opposite direction (agent-to-server) should use that same transport). This will enable the RHQ Server to open a special server-side socket that you designate that will be used to accept agent requests. This special socket will circumvent Tomcat and the Tomcat configuration - it will have its own SSL security configuration, allowing you to configure Tomcat to be less strict in the requests it accepts.
Using sslsocket requires your server to open another additional port, so if you have a firewall between your agents and server, you must punch a hole through your firewall so the agents can access this new port; otherwise, the agents will not be able to communicate with the server.
All of the steps covered in previous sections are still valid. The only difference in being able to use sslsocket versus sslservlet for agent-to-server communication is a few configuration setting changes. These differences will be explained below.
sslsocket RHQ Server Settings
In general, the rhq-server.properties security settings with the names that start with rhq.server.tomcat.security do not need to be changed since we aren't going to ask the agents to go through Tomcat. So those should be left as they were when the server was initially installed; instead, you will now want to use the rhq.communications.connector.security settings. In rhq-server.properties:
rhq.communications.connector.transport=sslsocket
rhq.communications.connector.bind-address=
rhq.communications.connector.bind-port=55555
rhq.communications.connector.transport-params=
...
# Server-side SSL Security Configuration (for incoming messages from agents)
# These are used when secure transports other than sslservlet are used
rhq.communications.connector.security.secure-socket-protocol=TLS
rhq.communications.connector.security.keystore.file=${jboss.server.config.dir}/server.keystore
rhq.communications.connector.security.keystore.algorithm=SunX509
rhq.communications.connector.security.keystore.type=JKS
rhq.communications.connector.security.keystore.password=jonpassword
rhq.communications.connector.security.keystore.key-password=jonpassword
rhq.communications.connector.security.keystore.alias=myhost
rhq.communications.connector.security.truststore.file=${jboss.server.config.dir}/all.truststore
rhq.communications.connector.security.truststore.algorithm=SunX509
rhq.communications.connector.security.truststore.type=JKS
rhq.communications.connector.security.truststore.password=jonpassword
rhq.communications.connector.security.client-auth-mode=true
Here the transport is now sslsocket. Because we are using sslsocket transport, you need to indicate which port to bind to (this is the port the server will listen to when receiving agent requests - in this example we used port 55555 but you can use any free port). The bind-address can still be left as-is, it will pick up a default for the server. You can specify a bind-address if you want to explicitly tell the server what to bind to. The transport-params can be any valid JBoss/Remoting transport parameters - this can be left blank. See Communications Configuration or the JBoss/Remoting documentation for more information on what you can do with these transport parameters.
For the security settings, all have the same values as before except their names start with rhq.communications.connector.security, not rhq.server.tomcat.security.
After you made your changes, start the server then go to the Administration > Topology > Servers page and verify that the public endpoint address and port are the ones you want. If you see that these values do not match the same values that you just configured above, the agent will not be able to talk to the server. Edit the server definition in the UI so they do match.
sslsocket RHQ Agent Settings
Very little has to change from the previous instructions to get the agent to talk to the server over the sslsocket protocol. The only difference is that you have to tell the agent to use the sslsocket transport, what the new port is and what the server's transport parameters are:
-
RHQ Server Port: enter the new port that the RHQ Server will be listening to for agent requests. The name for this configuration preference is rhq.agent.server.bind-port.
-
RHQ Server Transport Protocol, enter sslsocket. The name for this configuration preference is rhq.agent.server.transport.
-
RHQ Server Transport Parameters, enter the RHQ Server's new transport parameters as defined by its rhq.communications.connector.transport-params setting. The name for this configuration preference is rhq.agent.server.transport-params.
Troubleshooting Secure Communications Setup
Correct configuration for secure communications can be difficult at times because problems in any of the following areas can halt successful communications between server and agent and frustrate the process:
-
certificate creation and deployment
-
groups of server and agent configuration entries that must be set correctly for good communication between both sides
-
the decision to use socket or servlet transports has performance and client side ramifications
-
understanding when the RHQ Agent and RHQ Server are acting as clients to each other (i.e. the sender) and when they are the "server" (i.e. the receiver) and which settings modify the sender or receiver
If you've already gone through the detailed instructions above for setting up secure RHQ communications but are still having difficulties it is helpful to double check with the following steps.
RHQ Agent has no servlet engine and can only accept inbound communications over the socket or sslsocket protocol
Servlet based communications is used by both RHQ Agents (when sending message to the RHQ Server over the servlet or sslservlet protocol) and web clients. By requiring Client Authorization to secure RHQ Agents you are also requiring all browser clients to need certificates just to browse the RHQ UI as mentioned in the above sections. If you can't get this to work, the simplest solution is to fall back to sslsocket protocol for Server <-> Agent communication and retain default web accessibility, unless you require the additional security.
For simplicity we'll assume that you have addressed the following fundamental setup instructions:
Example of relevant RHQ Server default settings (security turned off) in <rhq-server-install-dir>/bin/rhq-server.properties
# RHQ Server's remote endpoint for agents to talk to
# bind-address and bind-port are derived from the HA server definition,
# if you set the address/port here, they will override the HA server
# definition found in the database
rhq.communications.connector.transport=servlet
rhq.communications.connector.bind-address=
rhq.communications.connector.bind-port=
rhq.communications.connector.transport-params=/jboss-remoting-servlet-invoker/ServerInvokerServlet
...
# Server-side SSL Security Configuration for HTTPS thru Tomcat
# These are used for browser https access and
# for incoming messages from agents over sslservlet transport.
# [Due to issue https://issues.jboss.org/browse/WFLY-1177, you cannot change
# rhq.server.tomcat.security.keystore.file or rhq.server.tomcat.security.truststore.file
# after you install RHQ. If you need to change those again, you must manually do so in standalone-full.xml.]
rhq.server.tomcat.security.client-auth-mode=false
rhq.server.tomcat.security.secure-socket-protocol=TLS
rhq.server.tomcat.security.algorithm=SunX509
rhq.server.tomcat.security.keystore.alias=RHQ
rhq.server.tomcat.security.keystore.file=${jboss.server.config.dir}/rhq.keystore
rhq.server.tomcat.security.keystore.password=RHQManagement
rhq.server.tomcat.security.keystore.type=JKS
rhq.server.tomcat.security.truststore.file=${jboss.server.config.dir}/rhq.truststore
rhq.server.tomcat.security.truststore.password=RHQManagement
rhq.server.tomcat.security.truststore.type=JKS
# Server-side SSL Security Configuration (for incoming messages from agents)
# These are used when secure transports other than sslservlet are used
rhq.communications.connector.security.secure-socket-protocol=TLS
rhq.communications.connector.security.keystore.file=${jboss.server.config.dir}/rhq.keystore
rhq.communications.connector.security.keystore.algorithm=SunX509
rhq.communications.connector.security.keystore.type=JKS
rhq.communications.connector.security.keystore.password=RHQManagement
rhq.communications.connector.security.keystore.key-password=RHQManagement
rhq.communications.connector.security.keystore.alias=RHQ
rhq.communications.connector.security.truststore.file=${jboss.server.config.dir}/rhq.truststore
rhq.communications.connector.security.truststore.algorithm=SunX509
rhq.communications.connector.security.truststore.type=JKS
rhq.communications.connector.security.truststore.password=RHQManagement
rhq.communications.connector.security.client-auth-mode=none
# Client-side SSL Security Configuration (for outgoing messages to agents)
rhq.server.client.security.secure-socket-protocol=TLS
rhq.server.client.security.keystore.file=${jboss.server.config.dir}/rhq.keystore
rhq.server.client.security.keystore.algorithm=SunX509
rhq.server.client.security.keystore.type=JKS
rhq.server.client.security.keystore.password=RHQManagement
rhq.server.client.security.keystore.key-password=RHQManagement
rhq.server.client.security.keystore.alias=RHQ
rhq.server.client.security.truststore.file=${jboss.server.config.dir}/rhq.truststore
rhq.server.client.security.truststore.algorithm=SunX509
rhq.server.client.security.truststore.type=JKS
rhq.server.client.security.truststore.password=RHQManagement
rhq.server.client.security.server-auth-mode-enabled=false
Examples of relevant RHQ Agent default settings (security turned off) in <rhq-agent-install-dir>/conf/agent-configuration.xml
<entry key="rhq.agent.server.transport" value="servlet" />
<entry key="rhq.agent.server.bind-port" value="7080" />
<!--
<entry key="rhq.agent.server.bind-address" value="127.0.0.1" />
-->
<entry key="rhq.agent.server.transport-params" value="/jboss-remoting-servlet-invoker/ServerInvokerServlet" />
...
<entry key="rhq.communications.connector.transport" value="socket" />
<entry key="rhq.communications.connector.bind-port" value="16163" />
<!--
<entry key="rhq.communications.connector.bind-address" value="127.0.0.1" />
<entry key="rhq.communications.connector.transport-params" value="serverBindAddress=127.0.0.1& \
serverBindPort=16163&numAcceptThreads=3&maxPoolSize=303&clientMaxPoolSize=304& \
socketTimeout=60000&enableTcpNoDelay=true&backlog=200" />
<entry key="rhq.communications.connector.lease-period" value="5000" />
-->
...
<entry key="rhq.communications.connector.security.client-auth-mode" value="none" />
...
<entry key="rhq.agent.client.security.server-auth-mode-enabled" value="false" />
Unencrypted/unsecured Communication Setup
SSL Communication(Encryption only) Setup
SSL Communication(Encryption with Client Cert Authentication) Setup